<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>左右跳动</title>
</head>
<style>
.d1{ width:auto; height:150px; border:1px soild;}
h1:hover { color:#33F; text-align:right;}

</style>
<body>
<script type="text/javascript">
 function a1(){
   
 }
</script>
<div class="d1" onClick="a1()">
<h1>JavaScript</h1>
</div>

</body>
</html>